<?php

namespace Home\Model;
use Think\Model;

class UservaultModel extends Model {
	protected $tableName = 'user_vault';
	//记录用户账户
	public function writeVault(){

	}

	//获取账户明细
	public function getInfo($uid=null){
		if(empty($uid)) return null;

		$where['uid'] = $uid;
		return $info = $this->where($where)->find();
	}
	
	//更新账户
	public function updateVault($uid=null,$amount){
		if(empty($uid)) return false;
		if(empty($amount) || !is_numeric($amount)) return false;

		$where['uid'] = $uid;
		return $this->where($where)->setDec('amount',$amount);
	}
	
}

?>